<template>
	<diy-page>
		<block v-for="(item, index) in pageConfig" :key="index">
			<diy-layer-banner v-if="item.component == 'diy-banner'" :config="item.assemblyProps" />
			<diy-member v-else-if="item.component == 'diy-member'" :config="item.assemblyProps" />
		</block>
		<Menu />
		<Hot />
	</diy-page>
</template>

<script setup>
	import DiyPage from '@/diy/diy-page/diy-page.vue';
	import DiyLayerBanner from '@/diy/diy-layer-banner/diy-layer-banner.vue';
	import DiyMember from '@/diy/components/member.vue';
	import Menu from './components/menu.vue';
	import Hot from './components/hot.vue';
	import {
		ref
	} from 'vue';
	import {
		onShow
	} from '@dcloudio/uni-app';

	const pageConfig = ref([{
		component: 'diy-banner',
		assemblyProps: {
			duration: 500,
			height: 350,
			list: [{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1704211685315.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1704211687589.png",
					"name": "阿胶奶茶",
					"page": "nayuki://pindao.cn/shopMenu/shopMenu?groupId=40335"
				},
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1703728667971.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1703728670590.png",
					"name": "年报",
					"page": "nayuki://pindao.cn/annualReport/index/index?ari=419&cnc=CESg8779aH7"
				}

				,
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1703604583350.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1703604585521.png",
					"name": "霸气车厘子",
					"page": "nayuki://pindao.cn/shopMenu/shopMenu?groupId=40332"
				}

				,
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1702998538046.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1702998539698.png",
					"name": "超厚芋泥",
					"page": "nayuki://pindao.cn/shopMenu/shopMenu?groupId=40328"
				}

				,
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1702636984635.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1702636986446.png",
					"name": "八香主k",
					"page": "nayuki://pindao.cn/shopMenu/shopMenu?groupId=40307"
				}

				,
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1694428645178.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1694428648907.png",
					"name": "周一免配日",
					"page": "nayuki://pindao.cn/shopMenu/shopMenu?cnc=CESr5QL3aY8"
				}

				,
				{
					"image": "https://trade-marketing-prod-oss.pin-dao.cn/product/1704357922534.png",
					"bgImage": "https://trade-marketing-prod-oss.pin-dao.cn/product/1704357927974.png",
					"name": "储值有礼",
					"page": "nayuki://pindao.cn/userCenter/memberRecharge?cnc=CESFIN4KaMP"
				}
			]
		},
	}, {
		component: 'diy-member',
		assemblyProps: {
			//marginTop: -40,
			marginBottom: 15,
			borderRadius: 10,
			color: 'rgba(51,51,51,1)',
			backgroundColor: 'rgba(255,255,255,1)',
		}
	}]);

	onShow(() => {
		uni.pageScrollTo({
			scrollTop: 0,
			duration: 300,
		});
	});
</script>

<style lang="scss" scoped>
	.page {
		background-color: #f5f5f5;
		//padding-bottom: 80px;
	}
</style>